// 查询的项目类型
export enum QueryType {
    FlightQuery = '航班查询',
    BusQuery = '巴士查询',
    HotelQuery = '酒店查询',
    CustomersQuery = '用户查询',
    ReservationQuery = '预约查询'
}
// 预约类型
export const ReservationType = {
    Flight:1,
    Bus:2,
    Hotel:3,
    getTypeName:(index:number):string=>{
        switch (index) {
            case 1:return '航班';
            case 2:return '巴士';
            case 3:return '酒店';
            default: return 'null';
        }
    }
}
// 定义查询参数类型
export interface QueryParams {
    // 航班查询参数
    flightNum: string,
    fromCity: string,
    arivCity: string,

    // 巴士查询
    busLocation: string,

    //酒店查询
    hotelLocation: string,
    max_price: number,
    min_price: number,

    // 用户
    customerName: string,

    // 预约
    reservationOwner: string,
    reservationType: Array<number>,
}

// 航班
export interface FlightData {
    flightNum: string,
    price: number,
    totalSeat: number,
    availSeat: number,
    fromCity: string,
    arivCity: string
}
// 巴士
export interface BusData {
    location: string,
    price: number,
    totalBus: number,
    availBus: number,
}
// 酒店信息
export interface HotelData {
    location: string,
    price: number,
    totalRoom: number,
    availRoom: number
}
// 用户信息
export interface CustomerData {
    customerName: string,
    customerId: string
}
export interface ReservationData {
    customerName: string,
    reservationType: number,
    reservationKey: string
}
// 定义联合类型
export type AnyData = FlightData | BusData | HotelData | CustomerData | ReservationData | undefined ;

// 定义表格数据类型
export interface TableData {
    flightData: FlightData[],
    busData: BusData[],
    hotelData: HotelData[],
    customerData: CustomerData[],
    reservationData: ReservationData[],
}

// 回应数据类型
export interface ApiResponse<T = any> {
    success: boolean;
    message?: string;
    data?: T;
    count?: number;
    error?: string;
}

export interface User {
    customerId: string
    customerName: string
    rememberMe: boolean
}

// 路线类型
export interface RoutePointCoordination{
    routePoint: RoutePoint,
    x:number,
    y:number,
}

// 旅游路径点
export interface RoutePoint{
    location:string,
    isBusReserved:boolean,
    isHotelReserved:boolean,
}
// 旅游航班转移
export interface RouteTransport{
    fromCity: string,
    arivCity: string
}